package router

import (
	"github.com/gin-gonic/gin"
	"go.uber.org/zap"
	"project_api/user_web/api"
	"project_api/user_web/middlewares"
)

func InitUserRouter(Router *gin.RouterGroup) {
	//UserRouter := Router.Group("user")
	UserRouter := Router.Group("api")
	zap.S().Info("配置用户相关的url")
	{
		UserRouter.GET("get_user_info", middlewares.TokenAuth(), api.GetUserInfo)
		UserRouter.GET("list", middlewares.TokenAuth(), api.GetUserList)
		UserRouter.GET("send_sms", middlewares.TokenAuth(), api.SendPasswordSms)
		UserRouter.GET("password_phone_check", middlewares.TokenAuth(), api.PasswordPhoneCheck)
		//UserRouter.GET("", middlewares.JWTAuth(), middlewares.IsAdminAuth(), api.GetUserList)
		UserRouter.POST("password_login", api.PasswordLogin)
		UserRouter.POST("sendSmsCodeV1", api.SendSmsCodeV1)
		UserRouter.POST("LoginCodeV1", api.LoginCodeV1)
		UserRouter.POST("OneClickReg", api.OneClickReg)
		//UserRouter.POST("register", api.Register)
		//
		//UserRouter.GET("detail", middlewares.JWTAuth(), api.GetUserDetail)
		//UserRouter.PATCH("update", middlewares.JWTAuth(), api.UpdateUser)
	}
	//服务注册和发现
}
